package com.hakim.wfb.common.enums;

/**
 * 用户等级枚举
 * Created by Administrator on 2017/7/5.
 */
public enum UserLevelEnum {

    NORMAL_USER(0, "普通用户"),
    MANAGER(1, "经理"),
    DIRECTOR(2, "总监"),
    PRESIDENT(3, "总裁");

    private int value;
    private String description;

    private UserLevelEnum(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    public static UserLevelEnum getByValue(int value) {
        UserLevelEnum[] codes = values();
        for (UserLevelEnum each : codes) {
            if (each.value == value) {
                return each;
            }
        }
        return null;
    }
}
